<?php
class Template_operador extends Controller
{

    function index()
    {
       // $data['mainacontent'] = 'operador_template';

        $this-> load->library('session');

        if(array_key_exists("username",$this->session->all_userdata()))
            {
                $username = $this->session->all_userdata()["username"];
                $es_administrador = $this->session->all_userdata()["es_administrador"];
                $es_operador = $this->session->all_userdata()["es_operador"];

                if($es_operador)
                {
                    $data['main_content'] = 'operador_template';
                    $data['username'] = $username;
                    $this->load->view('operador_template', $data);
                }
            }
      //  $this-> load->view('operador_template');
        //$this->load->view('includes/template', $data);


    }
}

function index()
{
    $this->load->library('session');

    if (array_key_exists("username",$this->session->all_userdata()))
    {
        $username = $this->session->all_userdata()["username"];
        $es_administrador =  $this->session->all_userdata()["es_administrador"];
        $es_operador =  $this->session->all_userdata()["es_operador"];

        if ($es_administrador)
        {
            $data['main_content'] = 'admin_template';
            $data['username'] = $username;
            $this->load->view('admin_template', $data);
        }
    }
}